﻿
using LaserAutoTest.Module;
using LaserAutoTest.UI.Views.Mains;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;

namespace LaserAutoTest.UI
{
    public class ModuleModule : IModule
    {
        private readonly IRegionManager _regionManager;

        public ModuleModule(IRegionManager regionManager)
        {
            _regionManager = regionManager;
        }
        /// <summary>
        /// 通知模块已被初始化。
        /// </summary>
        /// <param name="containerProvider"></param>
        public void OnInitialized(IContainerProvider containerProvider)
        {
            //_regionManager.RequestNavigate(RegionNames.AgingRegion, "AgingView");
            _regionManager.RequestNavigate(RegionNames.ContentRegion, "ContentView");
            _regionManager.RequestNavigate(RegionNames.TestRegion, "TestView");
            _regionManager.RequestNavigate(RegionNames.SettingRegion, "SettingView");
            _regionManager.RequestNavigate(RegionNames.BaiduRegion, "BaiduView");
        }
        /// <summary>
        /// 用于在您的应用程序将使用的容器中注册类型。
        /// </summary>
        /// <param name="containerRegistry"></param>
        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<ContentView>();
            containerRegistry.RegisterForNavigation<TestView>();
            containerRegistry.RegisterForNavigation<SettingView>();
            containerRegistry.RegisterForNavigation<BaiduView>();
        }
    }
}